package com.app.buss.ui.notifications;

import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

import com.app.buss.R;
import com.app.buss.adapter.MarketAdapter;
import com.app.buss.bean.MarketBean;

import java.util.ArrayList;
import java.util.List;

import androidx.annotation.NonNull;
import androidx.fragment.app.Fragment;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import butterknife.BindView;
import butterknife.ButterKnife;

public class NotificationsFragment extends Fragment {

    @BindView(R.id.rv_markets)
    RecyclerView rvMarkets;
    @BindView(R.id.toolbar_title)
    TextView toolbarTitle;
    private MarketAdapter adapter;
    private List<MarketBean> list = new ArrayList<>();

    public View onCreateView(@NonNull LayoutInflater inflater,
                             ViewGroup container, Bundle savedInstanceState) {
        View root = inflater.inflate(R.layout.fragment_notifications, container, false);
        ButterKnife.bind(this,root);
        toolbarTitle.setText("Markets");
        adapter = new MarketAdapter(list,getActivity());
        rvMarkets.setLayoutManager(new LinearLayoutManager(getActivity()));
        rvMarkets.setAdapter(adapter);
        initData();
        return root;
    }

    private void initData() {
        list.add(new MarketBean("USD/JPY","111.93700","111.92500","Sell"));
        list.add(new MarketBean("AUD/JPY","89.33900","80.31700","Buy"));
        list.add(new MarketBean("CAD/JPY","83.83700","83.81900","Sell"));
        list.add(new MarketBean("EUR/NZD","1.68131","1.68.83","Sell"));
        list.add(new MarketBean("EUR/USD","1.12961","1.12948","Buy"));
        list.add(new MarketBean("EUR/CAD","1.50817","1.50793","Sell"));
        list.add(new MarketBean("EUR/JPY","126.42700","126.41001","Sell"));
        list.add(new MarketBean("GBP/JPY","145.96200","145.96200","Buy"));
        list.add(new MarketBean("EUR/AUD","1.57385","1.57358","Sell"));
        list.add(new MarketBean("AUD/CAD","0.95847","0.95824","Buy"));
        list.add(new MarketBean("USD/CAD","1.33526","1.33503","Buy"));
        list.add(new MarketBean("GBP/USD","1.30408","1.30388","Sell"));
        list.add(new MarketBean("EUR/GBP","0.86625","0.86602","Buy"));
        list.add(new MarketBean("AUD/USD","0.71806","0.71789","Sell"));
        list.add(new MarketBean("EUR/GBP","0.86625","0.86602","Buy"));
        list.add(new MarketBean("USD/JPY","111.93700","111.92500","Sell"));
        list.add(new MarketBean("AUD/USD","0.71806","0.86602","Buy"));
        list.add(new MarketBean("NZD/USD","0.67213","0.67194","Sell"));
        list.add(new MarketBean("USD/JPY","111.93700","111.92500","Sell"));
        list.add(new MarketBean("EUR/JPY","126.42700","126.41001","Sell"));
    }
}
